import Screens from './Screens'
import {Appearance} from 'react-native-appearance'
import Color from "../utils/Color";

const selectedColor = Appearance.getColorScheme() === 'dark' ? '#31766D' : '#2882F8'
const MainRoot = {
    root: {
        stack: {
            children: [
                {
                    component: {
                        name: Screens.Home,
                        options: {
                            topBar: {
                                // 隐藏顶部导航栏
                                visible: false
                            }
                        }
                    }
                }
            ]
        },
        // 底部四个切换导航栏
        bottomTabs: {
            children: [
                // 首页tab配置
                {
                    stack: {
                        children: [{
                            component: { name: Screens.Home }
                        }],
                        options: {
                            bottomTab: {
                                // text: '首页',
                                icon: require('../../source/image/home_section_icon.png'),
                                // selectedIcon: require('../../source/image/home_section_icon.png'),
                                iconColor: '#999999',
                                selectedIconColor: selectedColor,
                                // selectedTextColor: '#fd2f2c',
                                // iconInsets: {
                                //     top: 5,
                                //     right: 5
                                // }
                            },
                            topBar: {
                                visible: false
                            }
                        }
                    }
                },
                // 分类tab配置
                {
                    stack: {
                        id: 'HomeIndex',
                        children: [{
                            component: { name: Screens.Move }
                        }],
                        options: {
                            bottomTab: {
                                // text: '分类',
                                icon: require('../../source/image/move_icon.png'),
                                iconColor: '#999999',
                                selectedIconColor: selectedColor,
                                // selectedIcon: require('../../source/image/move_icon.png'),
                                // selectedTextColor: '#fd2f2c'
                                // iconInsets: {
                                //     top: 5,
                                //     right: 5
                                // }
                            },
                            topBar: {
                                visible: false
                            }
                        }
                    }
                },
                // 设备tab配置
                {
                    stack: {
                        id: 'homeCart',
                        children: [{
                            component: { name: Screens.Devices }
                        }],
                        options: {
                            bottomTab: {
                                // text: '设备进货车',
                                icon: require('../../source/image/device_icon.png'),
                                // selectedIcon: require('../../source/image/device_icon.png'),
                                iconColor: '#999999',
                                selectedIconColor: selectedColor,
                                // iconInsets: {
                                //     top: 5,
                                //     right: 5
                                // }
                            },
                            topBar: {
                                visible: false
                            }
                        }
                    }
                },
                // 个人中心tab配置
                {
                    stack: {
                        children: [{
                            component: { name: Screens.My }
                        }],
                        options: {
                            bottomTab: {
                                // text: '个人中心',
                                icon: require('../../source/image/my_icon.png'),
                                iconColor: '#999999',
                                selectedIconColor: selectedColor,
                                // selectedIcon: require('../../source/image/my_icon.png'),
                                // selectedTextColor: '#fd2f2c'
                                // iconInsets: {
                                //     top: 5,
                                //     right: 5
                                // }
                            },
                            topBar: {
                                visible: false
                            },
                            statusBar: {
                                backgroundColor: '#e00000',
                                visible: false
                            }
                        }
                    }
                }
            ],
            options: {
                bottomTabs: {
                    backgroundColor: Appearance.getColorScheme() === 'dark' ? Color.darkBg : Color.lightBg
                },
                topBar: {
                    visible: false
                }
            }
        }
    }
}

export default MainRoot;
